#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：Employment_class 
@File    ：15_多任务实现-04_协程.py
@IDE     ：PyCharm 
@Author  ：XiaoDengYa
@Date    ：2021/7/6/006 16:40 
"""

import time

def A():
    while True:
        print("----A---")
        yield
        time.sleep(0.5)

def B(c):
    while True:
        print("----B---")
        c.next()
        time.sleep(0.5)

if __name__=='__main__':
    a = A()
    B(a)
